﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Weixin.MP.Web.Filters
{
    public class CheckUserLoginFilter : FilterAttribute
    {

        ////当方法执行时
        //public override void OnActionExecuting(ActionExecutingContext filterContext)
        //{
        //    //base.OnActionExecuting(filterContext);
        //    try
        //    {
        //        var sess = filterContext.RequestContext.HttpContext.Session["login"];
        //        if (sess == null || sess.ToString() != "True") filterContext.Result = new RedirectResult("/Home/login");
        //    }
        //    catch
        //    {
        //        filterContext.Result = new RedirectResult("/Shared/Error");
        //    }
        //}

        ////当方法执行完毕
        //public override void OnActionExecuted(ActionExecutedContext filterContext)
        //{
        //    base.OnActionExecuted(filterContext);
        //}

    }

}